<?php
namespace App\Services\IntegralGoods;

use App\Services\ProjectValidate;
/**
 * 商品模块验证规则集合
 *
 * Class ValidateGoods
 */
class ValidateGoods extends ProjectValidate
{
    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        // TODO: Implement initValidate() method.
        if (!empty($initData['id'])) {
            $this->rules['id']  = 'required|array|min:1';
        }
    }
    
    public $rules = [
        'id'            => 'int|min:1',
        'user_id'            => 'int|min:1',
        'cate_id'            => 'int|min:1',
        'number'            => 'int|min:1',
        'integral'            => 'int|min:1',
        'origin_number'            => 'int|min:1',
        'order'            => 'int|min:1',
        'operate_uid'            => 'int|min:1',
        'product_code' => 'min:10',
        'status'        => 'in:-1,0,1',
        'audit_status'  => 'in:-1,0,1',
        'title'    => 'between:2,25',
        'imgs_urls'=> 'min:1',
        'imgs_ids' => 'min:1',
        'desc' => 'min:2',
        'page'          => 'int|min:1',
        'listRows'      => 'integer|min:1|max:100'
    ];


    public $messages = [
       
    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
      
    ];
}